package misty.mispic.app

import javafx.application.Application
import javafx.application.Platform
import javafx.scene.Scene
import javafx.scene.paint.Color
import javafx.stage.Stage
import javafx.stage.StageStyle
import misty.mispic.app.ui.main.Main
import misty.mispic.app.ui.splash.Splash

/**
 * Created by Misty on 2015/1/15.
 */
class App extends Application {
    @Override
    void start(Stage primaryStage) {
        primaryStage.setScene(new Scene(new Splash(), Color.TRANSPARENT))
        primaryStage.centerOnScreen()
        primaryStage.initStyle(StageStyle.TRANSPARENT)
        primaryStage.show()

        new Thread({
            sleep(200)
            Platform.runLater {
                new Stage().with {
                    scene = new Scene(new Main())
                    show()
                }
                primaryStage.close()
            }
        }).start()
    }

    static void main(String... args) {
        launch(App.class, args)
    }
}
